﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RoadTeam.Model;
using RoadTeam.BLL;
using System.Data;
using System.Xml.Serialization;
using RoadTeam.Standard;

public partial class 对接测试页面_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SysUserBLL bll = new SysUserBLL();
        DataTable dt = bll.GetLoginInfo(TextBox1.Text, TextBox2.Text);
        LoginInfo info = new LoginInfo();
        if (dt.Rows.Count == 0)
        {
            info.IsLoginSuccess = false;
        }
        else
        {
            info.IsLoginSuccess = true;
            info.UserIdentifier = dt.Rows[0]["UserIdentifier"].ToString();
            info.UserName = dt.Rows[0]["UserName"].ToString();
            info.UserLoginID = dt.Rows[0]["UserLoginID"].ToString();
            info.UserTypeName = dt.Rows[0]["UserTypeName"].ToString();
            //info.UserState = (dt.Rows[0]["UserState"] != null && !String.IsNullOrEmpty(dt.Rows[0]["UserState"].ToString())) ? false : Convert.ToBoolean(dt.Rows[0]["UserState"]);
            info.OrganIdentifier = dt.Rows[0]["OrganIdentifier"].ToString();
        }

        Response.Write("<P>UserIdentifier:" + info.UserIdentifier + "</P>");
        Response.Write("<P>IsLoginSuccess:" + info.IsLoginSuccess + "</P>");




    }
    protected void Button2_Click(object sender, EventArgs e)
    {

    }
}

///// <summary>
///// 返回登录信息
///// </summary>
//public class LoginInfo
//{
//    [XmlElement(ElementName = "IsLoginSuccess")]
//    public bool IsLoginSuccess;
//    [XmlElement(ElementName = "UserIdentifier")]
//    public String UserIdentifier;
//    [XmlElement(ElementName = "UserName")]
//    public String UserName;
//    [XmlElement(ElementName = "UserLoginID")]
//    public String UserLoginID;
//    [XmlElement(ElementName = "UserTypeName")]
//    public String UserTypeName;
//    [XmlElement(ElementName = "UserState")]
//    public bool UserState;
//}

///// <summary>
///// 返回修改密码后的信息
///// 是否修改成功
///// </summary>
//public class UpdatePwd
//{
//    [XmlElement(ElementName = "IsUpdateSuccess")]
//    public bool IsUpdateSuccess;
//}


